<?php
namespace app\api\controller\com;
class Nav extends Base {
	//列表
	public function lists() {
		$d = $this->post;
		$rule = [
			'cat_id' => 'require',
		];
		$msg = [];
		check($rule, $msg, $d);
		$map = [];
		if ($d['cat_id'] != '') {
			$map[] = ['and', 'cat_id', '=', $d['cat_id']];
		}
		$map[] = ['and', 'status', '=', 0];
		$w = where($map);
		$rs = $this->db->query("select title,pic,url,ext from nav $w[0] order by sort desc", $w[1]);
		if ($rs) {
			suc($rs);
		}
		suc([], 0);
	}
}
